/*-------------------------------------------------
 *
 * OrbitsWriter - An Offline Blog Writer
 *
 * Copyright (C) 2012 devbean@galaxyworld.org
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *-------------------------------------------------*/

#include "dpointer.h"

/*!
  \class DPointer

  A common implmentation for d-pointer pattern.

  It should be used in any classes which need d-pointer.
  Use the following code:
  \code
  class MyClass {
      // ...
  private:
      D_POINTER
  };
  \endcode

  Macro \em D_POINTER should \code #include <DPointer>\endcode.
  This require an inner class, for example, we should add a class
  to satisfy previous code (mostly should be added in a CPP file):
  \code
  class MyClass::Private
  {
      // ...
  }
  \endcode

  If the private class need constructors with arguments, such as
  \code
  class MyClass2::Private
  {
  public:
      Private(Type t) {}
  }
  \endcode

  We could have the following code for \em MyClass2:
  \code
  // in H
  class MyClass2 {
      // ...
  private:
      D_POINTER
  };

  // in CPP
  MyClass2::MyClass2() : d(t) {}
  \endcode

  \note \em d generated by \em D_POINTER should \b NOT delete.
  Because \em d is not a pointer, you could still use \em -> operator.
  If this is not suitable for you, use \em get() function to get
  the underlying class pointer.
 */

/*!
  \macro D_POINTER

  Use this macro in any classes which need \em DPointer. This will
  add a \em d member as d-pointer.
 */

/*!
  \macro Q_POINTER

  This macro can be used to declare a private data class for \a CLASS
  with name \c q .

  This is a Q-Pointer declaration used in data classes. The Q-Pointer might
  be the public class to this data.
 */

/*!
  \fn DPointer::DPointer()

  Constructs an instance of DPointer with no argument for private class.
 */

/*!
  \fn DPointer::DPointer(Arg1 && arg1)

  Constructs an instance of DPointer with 1 argument for private class.
 */

/*!
  \fn DPointer::DPointer(Arg1 && arg1, Arg2 && arg2)

  Constructs an instance of DPointer with 2 arguments for private class.
 */

/*!
  \fn DPointer::DPointer(Arg1 && arg1, Arg2 && arg2, Arg3 && arg3)

  Constructs an instance of DPointer with 3 arguments for private class.
 */

/*!
  \fn DPointer::~DPointer()

  Destructs the instance of DPointer.
 */

/*!
  \fn T * DPointer::operator->() const

  Override \em -> operator in order to be used like a pointer.
 */

/*!
  \fn T * DPointer::get() const

  Returns the underlying data class pointer.
 */
